\documentclass[11pt,twoside,a4paper]{article}
\usepackage{amsmath}
\usepackage{array} %for arrays math
\usepackage{amsthm}
\usepackage{mathrsfs} %for caligraphic fonts
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage[english]{babel}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\graphicspath{ {figures/} }
\usepackage{microtype}
\usepackage{color}
\usepackage{Low_Mach}
\usepackage[dvipsnames]{xcolor}
\usepackage{float}
\usepackage{lmodern}
          %For clever references
          \usepackage{hyperref}
          \usepackage{cleveref}
          \usepackage{xparse}
\usepackage[top=1cm,left=2cm,right=2cm]{geometry}
\usepackage{filecontents}

\usepackage{caption}
\usepackage{subcaption} %for the subfigures

%\usepackage{biblatex}
%\usepackage[square]{natbib} %More bibliography options

%Tikz
\usepackage{tikz}
\usetikzlibrary{calc,trees,positioning,arrows,chains,shapes,%
    decorations.pathreplacing,decorations.pathmorphing,shapes,%
    matrix,shapes.symbols, backgrounds, shadows, arrows, plotmarks}
    
%Pgfplots
\usepackage{pgfplotstable}
\usepackage{pgfplots} 

\usepackage{makecell} % to split an tabular cell diagonally

\usepackage{xspace} %CS
\usepackage{listings} %Insert code block
\lstset{language=Fortran}
\usepackage{afterpage} %to force new page
\usepackage{tabulary}%To have greater flexibility on tabs


\definecolor{cornflowerblue}{RGB}{100,149,237}
\definecolor{ceruleanblue}{rgb}{0.16, 0.32, 0.75}
\definecolor{cadmiumgreen}{rgb}{0.0, 0.42, 0.24}
\definecolor{desertsand}{rgb}{0.93, 0.79, 0.69}
\definecolor{eggshell}{rgb}{0.94, 0.92, 0.84}


\title{{\huge \textbf{Simulation results report}} \\ A 1-D generalized Riemann problem}
\author{}


\begin{document}

\maketitle

\section{System: the Baer-Nunziato two-fluid model}

The Baer-Nunziato system is a two-fluid model originally formulated by Baer and Nunziato \cite{BaerNunziato1986} in the context of granular materials embedded in gaseous combustion products. 

\noindent In two-fluid models, both phases have their own dynamics in the system. In the specific context of isentropic Baer-Nunziato system (in which both energy equations are dropped off) each phase indexed $k\in \left\{1,\,2 \right\}$ has its own mass equation and momentum equation. A last transport equation involves a volume fraction variable $\alpha_1\in [0,\,1]$. The latter can be seen as a measure of the presence of phase $1$ in a given bounded domain. Consider the vector, 
%
\begin{equation}
\Uv = \left[ \alpha_1,\,m_1,\,m_1 u_1, \,m_2,\,m_2 u_2\right]^T.
\end{equation}
%
The isentropic Baer-Nunziato model finally reads $\forall k\in \left\{1,\,2 \right\}$:
%
\begin{equation}
\begin{array}{lcccccc}
\der{}{t}\alpha_k & + &u_{\I}\,\der{}{x}\alpha_k & &  &=& \left(-1 \right)^{k}\,\Kp\left(\Uv \right)\,\dpV, \\
\der{}{t} m_k     & + &\der{}{x}m_k u_k &  & &=& 0, \\
\der{}{t} m_k u_k & + &\der{}{x} \left(m_k u_k^2 + \alpha_k p_k\right) &-&p_{\I}\,\der{}{x}\alpha_k  &=& \left(-1 \right)^{k+1}\,\Ku\left( \Uv\right)\,\duV, 
\end{array}
\label{Isentropic_BN_Cons}
\end{equation} 
%
with $\rho_k$, $u_k$ and $p_k$ respectively the density, velocity and pressure of phase $k$. As for the partial mass $m_k$, it reads: $m_k = \alpha_k \rho_k$. Let us also define,
%
\begin{equation}
\begin{aligned}
\dpV &= p_2  - p_1, \\
\duV &= u_2  - u_1,
\end{aligned}
\end{equation}
%
the relative pressure and velocity. Eventually, $\Kp\left( \Uv\right)$ and $\Ku\left( \Uv\right)$ are positive cofactors whose definition will be discussed below. For both phases, pressure is a smooth function of density defined by the equation of state (EOS):
%
\begin{equation}
\begin{aligned}
&p_k = p_k^{\text{EOS}}\left(\rho_k \right),~\left(p_k^{\text{EOS}}\right)^{\prime}(\rho_k) > 0, \\
&\underset{\rho_k\rightarrow 0}{\lim} p_k = 0,~\underset{\rho_k\rightarrow \infty}{\lim} p_k = +\infty. 
\end{aligned}
\label{EOS_Properties}
\end{equation}
%
Since phases $1$ and $2$ are not miscible, volume fractions are constrained by the condition : 
%
\begin{equation}
\alpha_1 + \alpha_2 = 1.
\end{equation}
%
The equation of $\alpha_2$ is thus redundant with the one of $\alpha_1$. In \eqref{Isentropic_BN_Cons}, the couple of interfacial velocity and interfacial pressure $\left(u_\I,\,p_\I\right)$ needs to be specified with closure laws. Subsequently, this couple is set to
%
\begin{equation}
\left(u_\I,\,p_\I\right) = \left(u_2,\,p_1\right).
\label{BN_Closure_Laws}
\end{equation}
%
System \eqref{Isentropic_BN_Cons} admits pressure and velocity relaxation processes. Pressure relaxation acts on the transport equation of $\alpha_1$ through the term: 
%
\begin{equation}
\Kp\left(\Uv \right)\,\dpV = \frac{\alpha_1\,\alpha_2}{\tauP}\,\frac{\dpV}{p_1 + p_2},~\Ku\left(\Uv \right)\,\duV =\frac{1}{\tauU}\,\frac{m_1\,m_2}{m_1 + m_2}\,\duV,
\end{equation}
%
The stiffness of the pressure and velocity relaxation processes is given by the time-scales $\tauP$ and $\tauU$.
\newpage

\section{Test case presentation}

The execution of the file \texttt{RunSimulation.exe} triggers the resolution of the two-phase system \eqref{Isentropic_BN_Cons}. The computational domain is a 1-D pipe whose length is $1\,\mathrm{m}$. At time $t=0\,\mathrm{s}$, the domain is initially split in two different constant areas at $x=0.5\,\mathrm{m}$. The values of the different quantities in both areas are displayed in \tablename~\ref{Initial_Conditions_BN_Relaxation}.
%
 \begin{table}[http!]
\centering
\begin{tabular}{|c|c|c|c|c|c|}
\hline
 & $\alpha_1$ & $u_1~(m.s^{-1})$ & $p_1~(\text{bar})$ & $u_2~(m.s^{-1})$ & $p_2~(\text{bar})$ \\
 \hline
$\Wv_L^0~(x<0.5)$ &  $0.8$      & $1.5$ & $110$ & $-2$ & $170$\\
\hline
$\Wv_R^0~(x>0.5)$ &  $0.2$      & $2$   & $158$ & $-1.5$ & $120$\\
\hline
\end{tabular}
\caption{Generalized non-linear Riemann problem: initial conditions}
\label{Initial_Conditions_BN_Relaxation}
\end{table} 
%
The pressure and velocity relaxation time-scales are set equal to
%
\begin{equation}
\tauP = \tauU = 10^{-4}\,s,
\end{equation}
%
and the computational domain is discretized with a mesh made of $5\times 10^2$ cells. Finally the physical time of the simulation is $\Tend=2\times 10^{-4}\,\mathrm{s}$.

\section{Numerical results}

At the end of the simulation, the profile of each variable $p_1$, $p_2$, $u_1$, $u_2$ and $\alpha_1$ obtained by using the numerical solver ``BS'' (the numerical solver derived during my Ph.D) is displayed. Each profile is compared with the one of an other existing solver ``Rusanov'' known in the literature. Both solvers are also compared with a \textit{grid-converged} solution obtained by using a very thin mesh made of $10^5$ cells.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{figure}[http]
\centering

\begin{tikzpicture}

\begin{axis}[
grid=major,
xmin=0.2, xmax=0.8,
xlabel style={align=center}, xlabel={$x~(\mathrm{m})$ },
ylabel={$p_1~(\mathrm{bar})$},
legend pos= outer north east,
]

\addplot[color=black, mark=, very thick] table[x=x, y expr=\thisrow{P1}/100000]{../Figures/Grid_Converged_Solution.dat};

\addplot[color=blue, mark=x] table[x=x, y expr=\thisrow{P1}/100000]{../Output/Relaxation_BN_BS_non_stiff_relaxation_BAR__Cell500_ite80.dat};

\addplot[color=red, mark=x] table[x=x, y expr=\thisrow{P1}/100000]{../Figures/Computed_Solution_Rusanov.dat};

\legend{Grid-Converged, BS, Rusanov}

\end{axis}

\end{tikzpicture}  

\end{figure}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{figure}[http]
\centering

\begin{tikzpicture}

\begin{axis}[
grid=major,
xmin=0.2, xmax=0.8,
xlabel style={align=center}, xlabel={$x~(\mathrm{m})$ },
ylabel={$p_2~(\mathrm{bar})$},
legend pos= outer north east,
]

\addplot[color=black, mark=, very thick] table[x=x, y expr=\thisrow{P2}/100000]{../Figures/Grid_Converged_Solution.dat};

\addplot[color=blue, mark=x] table[x=x, y expr=\thisrow{P2}/100000]{../Output/Relaxation_BN_BS_non_stiff_relaxation_BAR__Cell500_ite80.dat};

\addplot[color=red, mark=x] table[x=x, y expr=\thisrow{P2}/100000]{../Figures/Computed_Solution_Rusanov.dat};

\legend{Grid-Converged, BS, Rusanov}

\end{axis}

\end{tikzpicture}  

\end{figure}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{figure}[http]
\centering

\begin{tikzpicture}

\begin{axis}[
grid=major,
xmin=0.2, xmax=0.8,
xlabel style={align=center}, xlabel={$x~(\mathrm{m})$ },
ylabel={$u_1~(\mathrm{m}.\mathrm{s}^-1)$},
legend pos= outer north east,
]

\addplot[color=black, mark=, very thick] table[x=x, y expr=\thisrow{U1}]{../Figures/Grid_Converged_Solution.dat};

\addplot[color=blue, mark=x] table[x=x, y expr=\thisrow{U1}]{../Output/Relaxation_BN_BS_non_stiff_relaxation_BAR__Cell500_ite80.dat};

\addplot[color=red, mark=x] table[x=x, y expr=\thisrow{U1}]{../Figures/Computed_Solution_Rusanov.dat};

\legend{Grid-Converged, BS, Rusanov}

\end{axis}

\end{tikzpicture}  

\end{figure}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{figure}[http]
\centering

\begin{tikzpicture}

\begin{axis}[
grid=major,
xmin=0.2, xmax=0.8,
xlabel style={align=center}, xlabel={$x~(\mathrm{m})$ },
ylabel={$u_2~(\mathrm{m}.\mathrm{s}^-1)$},
legend pos= outer north east,
]

\addplot[color=black, mark=, very thick] table[x=x, y expr=\thisrow{U2}]{../Figures/Grid_Converged_Solution.dat};

\addplot[color=blue, mark=x] table[x=x, y expr=\thisrow{U2}]{../Output/Relaxation_BN_BS_non_stiff_relaxation_BAR__Cell500_ite80.dat};

\addplot[color=red, mark=x] table[x=x, y expr=\thisrow{U2}]{../Figures/Computed_Solution_Rusanov.dat};

\legend{Grid-Converged, BS, Rusanov}

\end{axis}

\end{tikzpicture}  

\end{figure}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{figure}[http]
\centering

\begin{tikzpicture}

\begin{axis}[
grid=major,
xmin=0.2, xmax=0.8,
xlabel style={align=center}, xlabel={$x~(\mathrm{m})$ },
ylabel={$\alpha_1)$},
legend pos= outer north east,
]

\addplot[color=black, mark=, very thick] table[x=x, y expr=\thisrow{Alpha1}]{../Figures/Grid_Converged_Solution.dat};

\addplot[color=blue, mark=x] table[x=x, y expr=\thisrow{Alpha1}]{../Output/Relaxation_BN_BS_non_stiff_relaxation_BAR__Cell500_ite80.dat};

\addplot[color=red, mark=x] table[x=x, y expr=\thisrow{Alpha1}]{../Figures/Computed_Solution_Rusanov.dat};

\legend{Grid-Converged, BS, Rusanov}

\end{axis}

\end{tikzpicture}  

\end{figure}

\newpage

\bibliographystyle{plain} % Le style est mis entre accolades.

\bibliography{./biblio} % mon fichier de base de données


\end{document}